<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <body>

        <ui:composition template="./template.xhtml">
            <ui:define name="mainMenu">
                <ui:include src="mainMenu.xhtml"/>
            </ui:define>
            <ui:define name="navigation">
                <ui:include src="menu.xhtml"/>
            </ui:define>

            <ui:define name="content">
                <h1>
                    #{bundle.FpTitle} #{filmPageBean.film.titleOrg}
                </h1>
                <h:panelGrid styleClass="panelGrid" columns="2" columnClasses="rightAlign, leftAlign">
                    <h:outputText value="#{bundle.TitleEn}"/>
                    <h:outputText value="#{filmPageBean.film.titleEn}"/>


                    <h:outputText value="#{bundle.TitlePl}"/>
                    <h:outputText value="#{filmPageBean.film.titlePl}"/>

                    <h:outputText value="#{bundle.Year}"/>
                    <h:outputText value="#{filmPageBean.film.year}"/>

                    <h:outputText value="#{bundle.Genre}"/>
                    <h:panelGroup>                        
                            <c:forEach items="#{filmPageBean.film.genreses}" var="g">
                                <h:outputText rendered="#{languageSwitcher.language =='pl'}" value="#{g.namePl}"/>
                                <h:outputText rendered="#{languageSwitcher.language =='en'}" value="#{g.nameEn}"/>
                                <h:outputText value=", "/>
                            </c:forEach>                                                
                    </h:panelGroup>

                    <h:outputText value="#{bundle.Quality}"/>
                    <h:outputText value="#{filmPageBean.film.quality.name}"/>



                    <h:outputText value="#{bundle.Size}"/>
                    <h:outputText value="#{filmPageBean.film.fileSize}"/>


                </h:panelGrid>
                <h2>
                    <h:outputText style="margin-left: 50px" value="#{bundle.FpComments}"/>
                </h2>
                <c:forEach items="#{filmPageBean.film.commentses}" var="c">
                    <div class="panelGrid">
                    <h:outputText value="#{c.date} "/>
                    <h:outputText value="#{c.users.username}"/>
                    <br />
                    <h:outputText value="#{c.content}"/>
                    <br />
                    <h:outputText value="--------------------------------"/>
                    <br />
                    <br />
                    </div>
                </c:forEach>
                <h3>
                    <h:outputText style="margin-left: 50px;" value="#{bundle.FpAddComment}"/>
                </h3>
                <h:form styleClass="panelGrid">
                    <h:inputTextarea value="#{filmPageBean.comment}" required="true"/>
                    <br/>
                    <h:commandButton value="#{bundle.FpAdd}" action="#{filmPageBean.addComment(filmPageBean.id)}"/>
                </h:form>

            </ui:define>



        </ui:composition>

    </body>
</html>